package org.example.platform.service.impl;

import org.example.platform.dao.UserMapper;
import org.example.platform.entity.User;
import org.example.platform.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class UserServiceImpl implements UserService {

    @Autowired
    private UserMapper userMapper;

    @Override
    public List<User> selectList() {
        QueryWrapper<User> wrapper = new QueryWrapper<User>();
        wrapper.orderByAsc("id");
        List<User> users = userMapper.selectList(wrapper);
        return users;
    }

    @Override
    public int insert(User user) {
        return userMapper.insert(user);
    }
}
